package gameStream.stream
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Graphics;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import gameStream.display.BallDisplayData;
	
	import org.gof.state.IGOStatePosition;
	import org.gof.stream.BaseGameObject;
	
	public class BallGO extends BaseGameObject
	{
		
		protected var sprite:Sprite;
		protected var clickCallBack:Function;
		
		public function BallGO(sprite:Sprite,name:String, position:IGOStatePosition, clickCallBack:Function)
		{
			init(sprite);
			super(name,position, displayData);
			this.clickCallBack = clickCallBack;
			sprite.buttonMode = true;
		}
		public function reset():void
		{
			sprite.removeEventListener(MouseEvent.CLICK,handleClick);
		}
		
		private function handleClick(e:Event):void
		{
			clickCallBack();
		}
		private function init(sprite:Sprite):void
		{
			this.sprite = sprite;
			sprite.addEventListener(MouseEvent.CLICK,handleClick);
			displayData = new BallDisplayData(sprite,name);
				
		}
		
		
		
		
	
	}
}